package com.zjsru.service.impl;

import com.zjsru.pojo.Order;
import com.zjsru.service.OrderService;
import com.zjsru.mapper.OrderMapper;
import com.zjsru.feign.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Autowired
    private UserClient userClient;

    @Override
    public Order queryOrderById(Long id) {
        Order order = orderMapper.selectById(id);
        if (order != null) {
            order.setUser(userClient.getUserById(order.getUser_Id()));
        }
        return order;
    }

    // Other methods related to order processing can be added here
}